﻿/* 03. Write a method that returns the last digit of given integer as an English word. 
 * Examples: 512 -> 'two', 1024 -> 'four', 12309 -> 'nine'. */

using System;

public class LastDigit
{
    public static void Main()
    {
        int number = Common.InputInteger(string.Format("\nEnter an integer number: "));
        Console.WriteLine("It's last digit is {0}.\n", Last(number));
    }

    public static string Last(int number)
    {
        if (number < 0)
            number = -number;

        switch (number % 10)
        {
            case 0: return "zero";
            case 1: return "one";
            case 2: return "two";
            case 3: return "three";
            case 4: return "four";
            case 5: return "five";
            case 6: return "six";
            case 7: return "seven";
            case 8: return "eight";
            case 9: return "nine";
            default: return "";
        }
    }
}